#include<opencv2/opencv.hpp>
#include<iostream>
using namespace cv;
using namespace std;
int main()
{
    Mat img=imread("/home/lwj/opencv_projeci/2.png");
    Mat imge;
    Canny(img,imge,50,175);
    imshow("can",imge);
    Mat kernel=(Mat_<float>(3,3)<<1,2,1,2,0,2,1,2,1);//为归一化
    Mat kernel_norm=kernel/12;//归一化卷积核
    Mat result,gaosi,lapu;
     Laplacian(img,lapu,-1);
    imshow("lapu1",lapu);//未高斯化拉普轮廓
    filter2D(img,result,CV_32F,kernel_norm,Point(-1,-1),2,BORDER_CONSTANT);//普通卷积
    cout<<result;
    GaussianBlur(img,gaosi,Size(3,3),4);//高斯滤波
    Laplacian(gaosi,lapu,-1);//高斯化拉普
    //imshow("result",result);
     Canny(gaosi,imge,50,175);
    imshow("can2",imge);
    // imshow("gaosi",gaosi);
    // imshow("lapu",lapu);
   waitKey(0);
    return 0;
}